import React, { Component } from 'react'
import { Layout } from 'antd'

import MyFooter from '@component/MyFooter'
import LoginForm from './LoginForm'
import Logo from '../Logo'

import { logoUrl } from '@config/url'
import mem from '@utils/memory'

import style from './index.module.css'

const {Content} = Layout

export default class Login extends Component {
  render() {
    // console.log("login:", mem)
    if (mem.user && mem.user.uid) {
      this.props.history.replace('/home')
    }

    return (
      <Layout style={{height: '100vh', minHeight: 600}}>
        <Content className={style["content"]}>
          <Logo url={logoUrl}/>
          <LoginForm to="/home"/>
        </Content>
        <MyFooter />
      </Layout>
    )
  }
}
